<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>数据表格</title>
    <link href="../../assets/css/pearone.css" rel="stylesheet" />
    <link href="../../component/layui/css/layui.css" rel="stylesheet" />
    <link href="../../admin/css/pearButton.css" rel="stylesheet"/>
    <link href="../../admin/css/pearTable.css" rel="stylesheet"/>
    <link href="../../admin/css/pearCommon.css" rel="stylesheet"/>
    <style>
        body{
            margin:10px;
            background: whitesmoke;
        }
    </style>
</head>
<body>
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">登陆日志</li>
                <li>操作日志</li>
            </ul>
            <div class="layui-tab-content" >
                <div class="layui-tab-item layui-show">
                    <table id="operLogTable" lay-skin="line" lay-filter="dictTypeTable"></table>
                </div>
                <div class="layui-tab-item">
                    <table id="loginLogTable" lay-skin="line" lay-filter="dictTypeTable"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="status">
    {{#if (d.status == 200) { }}
    <button class="pear-btn pear-btn-success pear-btn-xs">200</button>
    {{# }else if(d.status == 500){ }}
    <button class="pear-btn pear-btn-danger pear-btn-xs">500</button>
    {{# } }}
</script>

<script src="../../component/layui/layui.js"></script>
<script>
    layui.use(['layer','element','form','table','jquery'], function() {
        var layer = layui.layer
            ,table = layui.table
            ,$ = layui.jquery
            ,form = layui.form
            ,element = layui.element;
        table.render({
            elem: '#operLogTable',
            url: '/system/operLog/data',
            page: true ,
            skin:'line',
            toolbar: false,
            cols:[
                [
                    {field: 'title', title: '模块'},
                    {field: 'brower', title: '浏览器'},
                    {field: 'status', title: '状态',templet:'#status'},
                    {field: 'businessType',title:'业务'},
                    {field: 'ip',title:'访问地址'},
                    {field: 'location', title: '操作系统'},
                    {field: 'createTime', title: '操作时间', templet:'#createTime'},
                    {field: 'operator', title: '操作人'}
                ]
            ]
        });

        table.render({
            elem: '#loginLogTable',
            url: '/system/operLog/data',
            page: true ,
            skin:'line',
            toolbar: false,
            cols:[
                [
                    {field: 'title', title: '模块'},
                    {field: 'type', title: '标识'},
                    {field: 'status', title: '状态'},
                    {field: 'createTime', title: '操作时间', templet:'#createTime'},
                    {field: 'operator', title: '操作人'}
                ]
            ]
        });

    });
</script>
</body>
</html>